cmake_minimum_required(VERSION 2.6)

project(ONVIF)
#打印
message(STATUS "binary dir: " ${PROJECT_BINARY_DIR})
message(STATUS "source dir: " ${PROJECT_SOURCE_DIR})
# 查找当前目录下的所有源文件
# 并将名称保存到 DIR_SRCS 变量
include_directories("${PROJECT_SOURCE_DIR}/onvif/include")
aux_source_directory(./onvif/ DIR_SRCS)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -g -ggdb -w -Wall -std=c++11 -fPIC -lpthread -lssl -lcrypto -DWITH_OPENSSL -DWITH_NONAMESPACES ")

#OPENSSL

# 生成链接库
add_library(Onvif_API SHARED ${DIR_SRCS})
target_link_libraries(Onvif_API libcrypto.so.1.1 libssl.so.1.1)

install(DIRECTORY ${PROJECT_SOURCE_DIR}/onvif/include/
    DESTINATION include)
install (TARGETS Onvif_API
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
